
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>10.4 Weibo 类 · 大数据 bigdata_hbase_atguigu 课堂笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content=" 李振超">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-page-toc-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism-solarizedlight.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-change_girls/girls.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../styles/website.css">
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    
    <link rel="prev" href="103-weiutil-lei.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://www.atguigu.com/" target="_blank" class="custom-link">联系我们</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    第 1 章 Hbase 简介
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" data-path="../11-shi-yao-shi-hbase.html">
            
                <a href="../11-shi-yao-shi-hbase.html">
            
                    
                    1.1 Hbase 概述
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.2" data-path="../12-hbase-te-dian.html">
            
                <a href="../12-hbase-te-dian.html">
            
                    
                    1.2 Hbase 特点
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3" data-path="../13-hbase-jia-gou.html">
            
                <a href="../13-hbase-jia-gou.html">
            
                    
                    1.3 Hbase 架构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.4" data-path="../14-hbase-zhong-de-ge-ge-zu-jian.html">
            
                <a href="../14-hbase-zhong-de-ge-ge-zu-jian.html">
            
                    
                    1.4 Hbase 中的各个组件
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.4.1" data-path="../14-hbase-zhong-de-ge-ge-zu-jian/141-regionserver.html">
            
                <a href="../14-hbase-zhong-de-ge-ge-zu-jian/141-regionserver.html">
            
                    
                    1.4.1 RegionServer 是什么
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.4.2" data-path="../14-hbase-zhong-de-ge-ge-zu-jian/142-region-shi-shi-yao.html">
            
                <a href="../14-hbase-zhong-de-ge-ge-zu-jian/142-region-shi-shi-yao.html">
            
                    
                    1.4.2 Region 是什么
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.4.3" data-path="../14-hbase-zhong-de-ge-ge-zu-jian/143-master-shi-shi-yao.html">
            
                <a href="../14-hbase-zhong-de-ge-ge-zu-jian/143-master-shi-shi-yao.html">
            
                    
                    1.4.3 Master 是什么
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.5" data-path="../14-hbase-cun-chu-de-yi-xie-gai-nian.html">
            
                <a href="../14-hbase-cun-chu-de-yi-xie-gai-nian.html">
            
                    
                    1.5 Hbase 存储的一些概念
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.5.1" data-path="../14-hbase-cun-chu-de-yi-xie-gai-nian/141-xing-952e28-row-key.html">
            
                <a href="../14-hbase-cun-chu-de-yi-xie-gai-nian/141-xing-952e28-row-key.html">
            
                    
                    1.5.1 行键(row key)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.5.2" data-path="../14-hbase-cun-chu-de-yi-xie-gai-nian/142-lie-zu-he-lie.html">
            
                <a href="../14-hbase-cun-chu-de-yi-xie-gai-nian/142-lie-zu-he-lie.html">
            
                    
                    1.5.2 列族和列
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.5.3" data-path="../14-hbase-cun-chu-de-yi-xie-gai-nian/143-dan-yuan-683c28-cell.html">
            
                <a href="../14-hbase-cun-chu-de-yi-xie-gai-nian/143-dan-yuan-683c28-cell.html">
            
                    
                    1.5.3 单元格(Cell)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.5.4" data-path="../14-hbase-cun-chu-de-yi-xie-gai-nian/144-region-he-xing-de-guan-xi.html">
            
                <a href="../14-hbase-cun-chu-de-yi-xie-gai-nian/144-region-he-xing-de-guan-xi.html">
            
                    
                    1.5.4 Region 和 行的关系
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.6" data-path="../16-hbase-he-guan-xi-xing-shu-ju-ku-de-dui-bi.html">
            
                <a href="../16-hbase-he-guan-xi-xing-shu-ju-ku-de-dui-bi.html">
            
                    
                    1.6 Hbase 和关系型数据库的对比
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../chapter1.html">
            
                <a href="../chapter1.html">
            
                    
                    第 2 章 Hbase 部署和基本配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../chapter1/21-zhun-bei-gong-zuo.html">
            
                <a href="../chapter1/21-zhun-bei-gong-zuo.html">
            
                    
                    2.1 准备工作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../chapter1/22-pei-zhi-hbase.html">
            
                <a href="../chapter1/22-pei-zhi-hbase.html">
            
                    
                    2.2 配置 Hbase
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../chapter1/23-qi-dong-hbase.html">
            
                <a href="../chapter1/23-qi-dong-hbase.html">
            
                    
                    2.3 启动 Hbase
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../di-3-zhang-hbase-shell-cao-zuo.html">
            
                <a href="../di-3-zhang-hbase-shell-cao-zuo.html">
            
                    
                    第 3 章 Hbase Shell 操作
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../di-3-zhang-hbase-shell-cao-zuo/31-ji-ben-cao-zuo.html">
            
                <a href="../di-3-zhang-hbase-shell-cao-zuo/31-ji-ben-cao-zuo.html">
            
                    
                    3.1 基本操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../di-3-zhang-hbase-shell-cao-zuo/32-biao-de-cao-zuo.html">
            
                <a href="../di-3-zhang-hbase-shell-cao-zuo/32-biao-de-cao-zuo.html">
            
                    
                    3.2 表的操作
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../di-4-zhang-hbase-shu-ju-jie-gou.html">
            
                <a href="../di-4-zhang-hbase-shu-ju-jie-gou.html">
            
                    
                    第 4 章 Hbase 数据模型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../di-5-zhang-hbase-nei-bu-yuan-li.html">
            
                <a href="../di-5-zhang-hbase-nei-bu-yuan-li.html">
            
                    
                    第 5 章 Hbase 内部原理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../di-5-zhang-hbase-nei-bu-yuan-li/51-hbase-shi-ru-he-cun-chu-shu-ju-de.html">
            
                <a href="../di-5-zhang-hbase-nei-bu-yuan-li/51-hbase-shi-ru-he-cun-chu-shu-ju-de.html">
            
                    
                    5.1 Hbase 是如何存储数据的
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1.1" data-path="../di-5-zhang-hbase-nei-bu-yuan-li/51-hbase-shi-ru-he-cun-chu-shu-ju-de/511-walyu-xie-ri-5fd729.html">
            
                <a href="../di-5-zhang-hbase-nei-bu-yuan-li/51-hbase-shi-ru-he-cun-chu-shu-ju-de/511-walyu-xie-ri-5fd729.html">
            
                    
                    5.1.1 WAL(预写日志)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.2" data-path="../di-5-zhang-hbase-nei-bu-yuan-li/51-hbase-shi-ru-he-cun-chu-shu-ju-de/912-region-he-store.html">
            
                <a href="../di-5-zhang-hbase-nei-bu-yuan-li/51-hbase-shi-ru-he-cun-chu-shu-ju-de/912-region-he-store.html">
            
                    
                    5.1.2 Region
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.3" data-path="../di-5-zhang-hbase-nei-bu-yuan-li/51-hbase-shi-ru-he-cun-chu-shu-ju-de/913-store.html">
            
                <a href="../di-5-zhang-hbase-nei-bu-yuan-li/51-hbase-shi-ru-he-cun-chu-shu-ju-de/913-store.html">
            
                    
                    5.1.3 Store
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../di-5-zhang-hbase-nei-bu-yuan-li/52-shu-ju-de-xie-ru-liu-cheng.html">
            
                <a href="../di-5-zhang-hbase-nei-bu-yuan-li/52-shu-ju-de-xie-ru-liu-cheng.html">
            
                    
                    5.2 数据的写入流程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../di-5-zhang-hbase-nei-bu-yuan-li/53-shu-ju-de-du-qu-liu-cheng.html">
            
                <a href="../di-5-zhang-hbase-nei-bu-yuan-li/53-shu-ju-de-du-qu-liu-cheng.html">
            
                    
                    5.3 数据的读取流程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../di-5-zhang-hbase-nei-bu-yuan-li/54-shu-ju-de-flush-guo-cheng.html">
            
                <a href="../di-5-zhang-hbase-nei-bu-yuan-li/54-shu-ju-de-flush-guo-cheng.html">
            
                    
                    5.4 数据的 Flush 过程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../di-5-zhang-hbase-nei-bu-yuan-li/55-shu-ju-de-he-bing-guo-cheng.html">
            
                <a href="../di-5-zhang-hbase-nei-bu-yuan-li/55-shu-ju-de-he-bing-guo-cheng.html">
            
                    
                    5.5 数据的合并过程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="../di-5-zhang-hbase-nei-bu-yuan-li/56-region-chai-fen.html">
            
                <a href="../di-5-zhang-hbase-nei-bu-yuan-li/56-region-chai-fen.html">
            
                    
                    5.6 Region 拆分
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../di-6-zhang-hbase-java-api-cao-zuo.html">
            
                <a href="../di-6-zhang-hbase-java-api-cao-zuo.html">
            
                    
                    第 6 章 Hbase Java API 操作
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../di-6-zhang-hbase-java-api-cao-zuo/61-huo-qu-configuration-dui-xiang.html">
            
                <a href="../di-6-zhang-hbase-java-api-cao-zuo/61-huo-qu-configuration-dui-xiang.html">
            
                    
                    6.1 获取 Configuration 对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../di-6-zhang-hbase-java-api-cao-zuo/62-pan-duan-biao-shi-fou-cun-zai.html">
            
                <a href="../di-6-zhang-hbase-java-api-cao-zuo/62-pan-duan-biao-shi-fou-cun-zai.html">
            
                    
                    6.2 判断表是否存在
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../di-6-zhang-hbase-java-api-cao-zuo/63-chuang-jian-biao.html">
            
                <a href="../di-6-zhang-hbase-java-api-cao-zuo/63-chuang-jian-biao.html">
            
                    
                    6.3 创建表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../di-6-zhang-hbase-java-api-cao-zuo/64-shan-chu-biao.html">
            
                <a href="../di-6-zhang-hbase-java-api-cao-zuo/64-shan-chu-biao.html">
            
                    
                    6.4 删除表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../di-6-zhang-hbase-java-api-cao-zuo/65-xiang-biao-zhong-cha-ru-shu-ju.html">
            
                <a href="../di-6-zhang-hbase-java-api-cao-zuo/65-xiang-biao-zhong-cha-ru-shu-ju.html">
            
                    
                    6.5 向表中插入数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../di-6-zhang-hbase-java-api-cao-zuo/66-shan-chu-duo-xing-shu-ju.html">
            
                <a href="../di-6-zhang-hbase-java-api-cao-zuo/66-shan-chu-duo-xing-shu-ju.html">
            
                    
                    6.6 删除多行数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../di-6-zhang-hbase-java-api-cao-zuo/67-huo-qu-biao-zhong-de-suo-you-shu-ju.html">
            
                <a href="../di-6-zhang-hbase-java-api-cao-zuo/67-huo-qu-biao-zhong-de-suo-you-shu-ju.html">
            
                    
                    6.7 获取表中的所有数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="../di-6-zhang-hbase-java-api-cao-zuo/68-huo-qu-mou-yi-xing-shu-ju.html">
            
                <a href="../di-6-zhang-hbase-java-api-cao-zuo/68-huo-qu-mou-yi-xing-shu-ju.html">
            
                    
                    6.8 获取某一行数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9" data-path="../di-6-zhang-hbase-java-api-cao-zuo/69-huo-qu-mou-yi-xing-zhi-ding-lie-de-shu-ju.html">
            
                <a href="../di-6-zhang-hbase-java-api-cao-zuo/69-huo-qu-mou-yi-xing-zhi-ding-lie-de-shu-ju.html">
            
                    
                    6.9 获取某一行指定列的数据
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../di-7-zhang-hbase-hemapreduce-jie-he.html">
            
                <a href="../di-7-zhang-hbase-hemapreduce-jie-he.html">
            
                    
                    第 7 章 Hbase 和 MapReduce 结合
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../di-7-zhang-hbase-hemapreduce-jie-he/71-kuai-su-ru-men.html">
            
                <a href="../di-7-zhang-hbase-hemapreduce-jie-he/71-kuai-su-ru-men.html">
            
                    
                    7.1 快速入门1:统计表中数据的行数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../di-7-zhang-hbase-hemapreduce-jie-he/72-kuai-su-ru-men-2-shi-yong-mapreduce-jiang-ben-di-shu-ju-dao-ru-de-hbase.html">
            
                <a href="../di-7-zhang-hbase-hemapreduce-jie-he/72-kuai-su-ru-men-2-shi-yong-mapreduce-jiang-ben-di-shu-ju-dao-ru-de-hbase.html">
            
                    
                    7.2 快速入门2:使用 MapReduce 将本地数据导入的 HBase
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../di-7-zhang-hbase-hemapreduce-jie-he/72-zi-ding-yi-hbase-mapreduce.html">
            
                <a href="../di-7-zhang-hbase-hemapreduce-jie-he/72-zi-ding-yi-hbase-mapreduce.html">
            
                    
                    7.3 自定义 HBase-MapReduce 之一
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../di-7-zhang-hbase-hemapreduce-jie-he/74-zi-ding-yi-hbase-mapreduce-zhi-er.html">
            
                <a href="../di-7-zhang-hbase-hemapreduce-jie-he/74-zi-ding-yi-hbase-mapreduce-zhi-er.html">
            
                    
                    7.4 自定义 HBase-MapReduce 之二
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../di-7-zhang-hbase-you-hua.html">
            
                <a href="../di-7-zhang-hbase-you-hua.html">
            
                    
                    第 8 章 Hbase 和 Hive 结合
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../di-7-zhang-hbase-you-hua/81-hive-he-hbase-de-bi-jiao.html">
            
                <a href="../di-7-zhang-hbase-you-hua/81-hive-he-hbase-de-bi-jiao.html">
            
                    
                    8.1 Hive 和 HBase 的比较
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../di-7-zhang-hbase-you-hua/82-hive-he-hbase-de-zheng-he.html">
            
                <a href="../di-7-zhang-hbase-you-hua/82-hive-he-hbase-de-zheng-he.html">
            
                    
                    8.2 Hive 和 HBase 整合
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.2.1" data-path="../di-7-zhang-hbase-you-hua/82-hive-he-hbase-de-zheng-he/821-pei-zhi.html">
            
                <a href="../di-7-zhang-hbase-you-hua/82-hive-he-hbase-de-zheng-he/821-pei-zhi.html">
            
                    
                    8.2.1 配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2.2" data-path="../di-7-zhang-hbase-you-hua/82-hive-he-hbase-de-zheng-he/822-an-li-1.html">
            
                <a href="../di-7-zhang-hbase-you-hua/82-hive-he-hbase-de-zheng-he/822-an-li-1.html">
            
                    
                    8.2.2 案例1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2.3" data-path="../di-7-zhang-hbase-you-hua/82-hive-he-hbase-de-zheng-he/823-an-li-2.html">
            
                <a href="../di-7-zhang-hbase-you-hua/82-hive-he-hbase-de-zheng-he/823-an-li-2.html">
            
                    
                    8.2.3 案例2
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../di-9-zhang-hbase-you-hua.html">
            
                <a href="../di-9-zhang-hbase-you-hua.html">
            
                    
                    第 9 章 HBase 优化
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../di-9-zhang-hbase-you-hua/91-gao-ke-yong.html">
            
                <a href="../di-9-zhang-hbase-you-hua/91-gao-ke-yong.html">
            
                    
                    9.1 高可用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../di-9-zhang-hbase-you-hua/92-yu-fen-qu.html">
            
                <a href="../di-9-zhang-hbase-you-hua/92-yu-fen-qu.html">
            
                    
                    9.2 预分区
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../di-9-zhang-hbase-you-hua/93-rowkey-she-ji.html">
            
                <a href="../di-9-zhang-hbase-you-hua/93-rowkey-she-ji.html">
            
                    
                    9.3 RowKey 设计
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="../di-9-zhang-hbase-you-hua/94-nei-cun-you-hua.html">
            
                <a href="../di-9-zhang-hbase-you-hua/94-nei-cun-you-hua.html">
            
                    
                    9.4 内存优化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.5" data-path="../di-9-zhang-hbase-you-hua/95-ji-chu-you-hua.html">
            
                <a href="../di-9-zhang-hbase-you-hua/95-ji-chu-you-hua.html">
            
                    
                    9.5 基础优化
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../di-10-zhang-hbase-shi-zhan-zhi-gu-li-wei-bo.html">
            
                <a href="../di-10-zhang-hbase-shi-zhan-zhi-gu-li-wei-bo.html">
            
                    
                    第 10 章 HBase 实战之谷粒微博
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="101-biao-jie-gou.html">
            
                <a href="101-biao-jie-gou.html">
            
                    
                    10.1 表结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="102-weiboconstant-lei.html">
            
                <a href="102-weiboconstant-lei.html">
            
                    
                    10.2 WeiboConstant 类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="103-weiutil-lei.html">
            
                <a href="103-weiutil-lei.html">
            
                    
                    10.3 WeiUtil 类
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.10.4" data-path="104-weibo-lei.html">
            
                <a href="104-weibo-lei.html">
            
                    
                    10.4 Weibo 类
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >10.4 Weibo 类</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="weibo&#x7C7B;">Weibo&#x7C7B;</h1>
<p>&#x8FD9;&#x4E2A;&#x7C7B;&#x4E2D;&#x653E;&#x4E86;&#x5404;&#x79CD;&#x5177;&#x4F53;&#x7684;&#x4E1A;&#x52A1;&#x903B;&#x8F91;&#x64CD;&#x4F5C;</p>
<pre class="language-"><code class="lang-java"><span class="token keyword">package</span> com<span class="token punctuation">.</span>atguigu<span class="token punctuation">.</span>weibo<span class="token punctuation">;</span>

<span class="token keyword">import</span> org<span class="token punctuation">.</span>apache<span class="token punctuation">.</span>hadoop<span class="token punctuation">.</span>hbase<span class="token punctuation">.</span>Cell<span class="token punctuation">;</span>
<span class="token keyword">import</span> org<span class="token punctuation">.</span>apache<span class="token punctuation">.</span>hadoop<span class="token punctuation">.</span>hbase<span class="token punctuation">.</span>CellUtil<span class="token punctuation">;</span>
<span class="token keyword">import</span> org<span class="token punctuation">.</span>apache<span class="token punctuation">.</span>hadoop<span class="token punctuation">.</span>hbase<span class="token punctuation">.</span>TableName<span class="token punctuation">;</span>
<span class="token keyword">import</span> org<span class="token punctuation">.</span>apache<span class="token punctuation">.</span>hadoop<span class="token punctuation">.</span>hbase<span class="token punctuation">.</span>client<span class="token punctuation">.</span>*<span class="token punctuation">;</span>
<span class="token keyword">import</span> org<span class="token punctuation">.</span>apache<span class="token punctuation">.</span>hadoop<span class="token punctuation">.</span>hbase<span class="token punctuation">.</span>util<span class="token punctuation">.</span>Bytes<span class="token punctuation">;</span>

<span class="token keyword">import</span> java<span class="token punctuation">.</span>io<span class="token punctuation">.</span>IOException<span class="token punctuation">;</span>
<span class="token keyword">import</span> java<span class="token punctuation">.</span>util<span class="token punctuation">.</span>ArrayList<span class="token punctuation">;</span>
<span class="token keyword">import</span> java<span class="token punctuation">.</span>util<span class="token punctuation">.</span>List<span class="token punctuation">;</span>

<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">Weibo</span> <span class="token punctuation">{</span>

    <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">main</span><span class="token punctuation">(</span>String<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span> <span class="token keyword">throws</span> IOException <span class="token punctuation">{</span>
        <span class="token comment">// &#x7A0B;&#x5E8F;&#x7684;&#x5165;&#x53E3;, &#x505A;&#x5404;&#x79CD;&#x6D4B;&#x8BD5;&#x7528;</span>

        <span class="token function">createNamespace</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

        <span class="token function">createContentTable</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token function">createRelationTable</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token function">createInboxTable</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token comment">//        addAttend(&quot;1001&quot;, &quot;1002&quot;);</span>
<span class="token comment">//        addAttend(&quot;1001&quot;, &quot;1003&quot;);</span>
<span class="token comment">//        addAttend(&quot;1002&quot;, &quot;1003&quot;);</span>

<span class="token comment">//        addData(&quot;1002&quot;, &quot;1002-&gt;1&quot;);</span>
<span class="token comment">//        addData(&quot;1002&quot;, &quot;1002 ---&gt; 2&quot;);</span>
<span class="token comment">//        addData(&quot;1002&quot;, &quot;1002 ---&gt; 3&quot;);</span>
<span class="token comment">//        addData(&quot;1002&quot;, &quot;1002 ---&gt; 4&quot;);</span>
<span class="token comment">//        addData(&quot;1002&quot;, &quot;1002 ---&gt; 5&quot;);</span>
<span class="token comment">//        addData(&quot;1003&quot;, &quot;1003 ---&gt; 1&quot;);</span>
        <span class="token function">showMsg</span><span class="token punctuation">(</span><span class="token string">&quot;1001&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment">//        addData(&quot;1003&quot;, &quot;1003 ---&gt; 3&quot;);</span>
        <span class="token function">removeAttends</span><span class="token punctuation">(</span><span class="token string">&quot;1001&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;1003&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token function">showMsg</span><span class="token punctuation">(</span><span class="token string">&quot;1001&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>


    <span class="token comment">/**
     * &#x521B;&#x5EFA;&#x547D;&#x540D;&#x7A7A;&#x95F4;
     *
     * @throws IOException
     */</span>
    <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">createNamespace</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token keyword">throws</span> IOException <span class="token punctuation">{</span>
        WeiboUtil<span class="token punctuation">.</span><span class="token function">createNameSpace</span><span class="token punctuation">(</span>WeiboConstant<span class="token punctuation">.</span>NAMESPACE<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token comment">/**
     * &#x521B;&#x5EFA;&#x5185;&#x5BB9;&#x8868;
     *
     * @throws IOException
     */</span>
    <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">createContentTable</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token keyword">throws</span> IOException <span class="token punctuation">{</span>
        WeiboUtil<span class="token punctuation">.</span><span class="token function">createTable</span><span class="token punctuation">(</span>WeiboConstant<span class="token punctuation">.</span>TBL_CONTENT<span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token string">&quot;info&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token comment">/**
     * &#x521B;&#x5EFA;&#x7528;&#x6237;&#x5173;&#x7CFB;&#x8868;
     *
     * @throws IOException
     */</span>
    <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">createRelationTable</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token keyword">throws</span> IOException <span class="token punctuation">{</span>
        WeiboUtil<span class="token punctuation">.</span><span class="token function">createTable</span><span class="token punctuation">(</span>WeiboConstant<span class="token punctuation">.</span>TBL_RELATION<span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token string">&quot;attends&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;fans&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token comment">/**
     * &#x521B;&#x5EFA;&#x6536;&#x4EF6;&#x7BB1;&#x8868;
     *
     * @throws IOException
     */</span>
    <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">createInboxTable</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token keyword">throws</span> IOException <span class="token punctuation">{</span>
        WeiboUtil<span class="token punctuation">.</span><span class="token function">createTable</span><span class="token punctuation">(</span>WeiboConstant<span class="token punctuation">.</span>TBL_INBOX<span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token string">&quot;info&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token comment">/**
     * &#x53D1;&#x5E03;&#x5FAE;&#x535A;
     * &#x9700;&#x8981;&#x505A;&#x4E24;&#x4EF6;&#x4E8B;:
     * 1. &#x628A;&#x6570;&#x636E;&#x5B58;&#x5165;&#x5230;&#x6307;&#x5B9A;&#x7528;&#x6237;&#x5185;&#x5BB9;&#x8868;&#x4E2D;
     * 2. &#x628A;&#x8FD9;&#x6761;&#x5FAE;&#x535A;&#x63A8;&#x9001;&#x5230;&#x6536;&#x4EF6;&#x7BB1;&#x8868;&#x4E2D;
     *
     * @param uid     &#x8BE5;&#x6761;&#x5FAE;&#x535A;&#x7684;uid
     * @param content &#x8BE5;&#x6761;&#x5FAE;&#x535A;&#x7684;&#x6587;&#x672C;&#x5185;&#x5BB9;
     */</span>
    <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">addData</span><span class="token punctuation">(</span>String uid<span class="token punctuation">,</span> String content<span class="token punctuation">)</span> <span class="token keyword">throws</span> IOException <span class="token punctuation">{</span>
        Connection conn <span class="token operator">=</span> ConnectionFactory<span class="token punctuation">.</span><span class="token function">createConnection</span><span class="token punctuation">(</span>WeiboUtil<span class="token punctuation">.</span>conf<span class="token punctuation">)</span><span class="token punctuation">;</span>

        <span class="token comment">// &#x6839;&#x636E;&#x7528;&#x6237;id, &#x4E3A;&#x6BCF;&#x4E00;&#x6761;&#x5FAE;&#x535A;&#x751F;&#x6210;&#x4E00;&#x4E2A;&#x552F;&#x4E00;&#x7684; rowKey</span>
        String rowKey <span class="token operator">=</span> uid <span class="token operator">+</span> <span class="token string">&quot;_&quot;</span> <span class="token operator">+</span> System<span class="token punctuation">.</span><span class="token function">currentTimeMillis</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

        <span class="token comment">// 1. &#x628A;&#x6570;&#x636E;&#x5B58;&#x5165;&#x5230;&#x5185;&#x5BB9;&#x8868;&#x4E2D;</span>
        Table contentTable <span class="token operator">=</span> conn<span class="token punctuation">.</span><span class="token function">getTable</span><span class="token punctuation">(</span>TableName<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span>WeiboConstant<span class="token punctuation">.</span>TBL_CONTENT<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        Put put <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Put</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span>rowKey<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        put<span class="token punctuation">.</span><span class="token function">addColumn</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span><span class="token string">&quot;info&quot;</span><span class="token punctuation">)</span><span class="token punctuation">,</span> Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span><span class="token string">&quot;content&quot;</span><span class="token punctuation">)</span><span class="token punctuation">,</span> Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span>content<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        contentTable<span class="token punctuation">.</span><span class="token function">put</span><span class="token punctuation">(</span>put<span class="token punctuation">)</span><span class="token punctuation">;</span>

        <span class="token comment">// 2. &#x628A;&#x8FD9;&#x6761;&#x5FAE;&#x535A;&#x63A8;&#x9001;&#x5230;&#x6536;&#x4EF6;&#x7BB1;&#x8868;&#x4E2D;</span>
        <span class="token comment">//2.1 &#x5728;&#x7528;&#x6237;&#x5173;&#x7CFB;&#x8868;&#x4E2D;&#x627E;&#x5230;&#x64CD;&#x4F5C;&#x8005;&#x7684;&#x6240;&#x6709;&#x7C89;&#x4E1D;</span>
        List<span class="token operator">&lt;</span><span class="token keyword">byte</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token operator">&gt;</span> fansUids <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">ArrayList</span><span class="token operator">&lt;</span><span class="token operator">&gt;</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>  <span class="token comment">// &#x5B58;&#x50A8;&#x8FD9;&#x4E2A;&#x7528;&#x6237;&#x7684;&#x6240;&#x6709;&#x7684;&#x7C89;&#x4E1D;&#x7684; uid</span>
        Table relationTable <span class="token operator">=</span> conn<span class="token punctuation">.</span><span class="token function">getTable</span><span class="token punctuation">(</span>TableName<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span>WeiboConstant<span class="token punctuation">.</span>TBL_RELATION<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        Get get <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Get</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span>uid<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        get<span class="token punctuation">.</span><span class="token function">addFamily</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span><span class="token string">&quot;fans&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        Result result <span class="token operator">=</span> relationTable<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span>get<span class="token punctuation">)</span><span class="token punctuation">;</span>
        List<span class="token generics function"><span class="token punctuation">&lt;</span>Cell<span class="token punctuation">&gt;</span></span> cells <span class="token operator">=</span> result<span class="token punctuation">.</span><span class="token function">listCells</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span>cells <span class="token operator">!=</span> null<span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token keyword">for</span> <span class="token punctuation">(</span>Cell cell <span class="token operator">:</span> cells<span class="token punctuation">)</span> <span class="token punctuation">{</span>
                fansUids<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>CellUtil<span class="token punctuation">.</span><span class="token function">cloneQualifier</span><span class="token punctuation">(</span>cell<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
        <span class="token comment">//2.2 &#x63A8;&#x9001;&#x5230;&#x6536;&#x4EF6;&#x7BB1;&#x8868;&#x4E2D;  &#x884C;&#x5C31;&#x662F;&#x7C89;&#x4E1D;&#x7684;id</span>
        Table inboxTable <span class="token operator">=</span> conn<span class="token punctuation">.</span><span class="token function">getTable</span><span class="token punctuation">(</span>TableName<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span>WeiboConstant<span class="token punctuation">.</span>TBL_INBOX<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">byte</span><span class="token punctuation">[</span><span class="token punctuation">]</span> fansUid <span class="token operator">:</span> fansUids<span class="token punctuation">)</span> <span class="token punctuation">{</span>
            Put put1 <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Put</span><span class="token punctuation">(</span>fansUid<span class="token punctuation">)</span><span class="token punctuation">;</span>  <span class="token comment">// &#x6536;&#x4EF6;&#x7BB1;&#x4E2D;&#x7684;rowkey&#x5C31;&#x662F;&#x7C89;&#x4E1D;&#x7684;id</span>
            <span class="token comment">// &#x5217;&#x65CF;: info, &#x5217;: &#x7528;&#x6237;id, &#x503C;: &#x6BCF;&#x6761;&#x5FAE;&#x535A;&#x7684;rowkew</span>
            put1<span class="token punctuation">.</span><span class="token function">addColumn</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span><span class="token string">&quot;info&quot;</span><span class="token punctuation">)</span><span class="token punctuation">,</span> Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span>uid<span class="token punctuation">)</span><span class="token punctuation">,</span> Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span>rowKey<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            inboxTable<span class="token punctuation">.</span><span class="token function">put</span><span class="token punctuation">(</span>put1<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>

        <span class="token comment">// &#x5173;&#x95ED;&#x8D44;&#x6E90;</span>
        contentTable<span class="token punctuation">.</span><span class="token function">close</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        relationTable<span class="token punctuation">.</span><span class="token function">close</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        inboxTable<span class="token punctuation">.</span><span class="token function">close</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        conn<span class="token punctuation">.</span><span class="token function">close</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token comment">/**
     * &#x5173;&#x6CE8;&#x7528;&#x6237; &#x529F;&#x80FD;
     * &lt;p&gt;
     * 1. &#x5728;&#x7528;&#x6237;&#x5173;&#x7CFB;&#x8868;&#x4E2D; uid(&#x5173;&#x6CE8;&#x4EBA;) &#x8FD9;&#x4E00;&#x884C; attends &#x65CF;&#x4E2D;&#x6DFB;&#x52A0;&#x4E00;&#x5217;: &#x5217;&#x540D;&#x5C31;&#x662F;attendedUid(&#x88AB;&#x5173;&#x6CE8;&#x4EBA;), &#x5217;&#x503C;&#x53EF;&#x4EE5;&#x4E0D;&#x9700;&#x8981;
     * 2. &#x5728;&#x7528;&#x6237;&#x5173;&#x7CFB;&#x8868;&#x4E2D; attendedUid(&#x88AB;&#x5173;&#x6CE8;&#x4EBA;) &#x8FD9;&#x4E00;&#x884C;&#x7684; fans &#x65CF;&#x4E2D;&#x6DFB;&#x52A0;&#x4E00;&#x5217;: &#x5217;&#x540D;&#x662F; uid(&#x5173;&#x6CE8;&#x4EBA;,&#x5176;&#x5B9E;&#x5C31;&#x662F;&#x7C89;&#x4E1D;), &#x5217;&#x503C;&#x53EF;&#x4EE5;&#x4E0D;&#x9700;&#x8981;
     * 3. &#x5728;&#x6536;&#x4EF6;&#x7BB1;&#x8868;&#x4E2D; uid(&#x5173;&#x6CE8;&#x4EBA;, &#x662F;&#x522B;&#x4EBA;&#x7684;&#x7C89;&#x4E1D;) &#x8FD9;&#x4E00;&#x884C;, info &#x65CF;&#x6DFB;&#x52A0;&#x4E00;&#x5217;: &#x5217;&#x540D;&#x662F; attendedUid, &#x5217;&#x503C;&#x5C31;&#x662F; attendedUid &#x7684;&#x6700;&#x65B0;&#x7684;&#x4E09;&#x6761;&#x5FAE;&#x535A;.
     *
     * @param uid         &#x9700;&#x8981;&#x5173;&#x6CE8;&#x7528;&#x6237;&#x7684;&#x7528;&#x6237;id
     * @param attendedUid &#x88AB;&#x5173;&#x6CE8;&#x7684;&#x7528;&#x6237;&#x7684;id
     */</span>
    <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">addAttend</span><span class="token punctuation">(</span>String uid<span class="token punctuation">,</span> String attendedUid<span class="token punctuation">)</span> <span class="token keyword">throws</span> IOException <span class="token punctuation">{</span>
        Connection conn <span class="token operator">=</span> ConnectionFactory<span class="token punctuation">.</span><span class="token function">createConnection</span><span class="token punctuation">(</span>WeiboUtil<span class="token punctuation">.</span>conf<span class="token punctuation">)</span><span class="token punctuation">;</span>

        <span class="token comment">/*1. &#x5728;&#x7528;&#x6237;&#x5173;&#x7CFB;&#x8868;&#x4E2D; uid(&#x5173;&#x6CE8;&#x4EBA;) &#x8FD9;&#x4E00;&#x884C; attends &#x65CF;&#x4E2D;&#x6DFB;&#x52A0;&#x4E00;&#x5217;: &#x5217;&#x540D;&#x5C31;&#x662F;attendedUid(&#x88AB;&#x5173;&#x6CE8;&#x4EBA;), &#x5217;&#x503C;&#x53EF;&#x4EE5;&#x4E0D;&#x9700;&#x8981;*/</span>
        Table relationTable <span class="token operator">=</span> conn<span class="token punctuation">.</span><span class="token function">getTable</span><span class="token punctuation">(</span>TableName<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span>WeiboConstant<span class="token punctuation">.</span>TBL_RELATION<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        Put put1 <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Put</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span>uid<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        put1<span class="token punctuation">.</span><span class="token function">addColumn</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span><span class="token string">&quot;attends&quot;</span><span class="token punctuation">)</span><span class="token punctuation">,</span> Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span>attendedUid<span class="token punctuation">)</span><span class="token punctuation">,</span> Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span><span class="token string">&quot;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        relationTable<span class="token punctuation">.</span><span class="token function">put</span><span class="token punctuation">(</span>put1<span class="token punctuation">)</span><span class="token punctuation">;</span>

        <span class="token comment">/*2. &#x5728;&#x7528;&#x6237;&#x5173;&#x7CFB;&#x8868;&#x4E2D; attendedUid(&#x88AB;&#x5173;&#x6CE8;&#x4EBA;) &#x8FD9;&#x4E00;&#x884C;&#x7684; fans &#x65CF;&#x4E2D;&#x6DFB;&#x52A0;&#x4E00;&#x5217;: &#x5217;&#x540D;&#x662F; uid(&#x5173;&#x6CE8;&#x4EBA;,&#x5176;&#x5B9E;&#x5C31;&#x662F;&#x7C89;&#x4E1D;), &#x5217;&#x503C;&#x53EF;&#x4EE5;&#x4E0D;&#x9700;&#x8981;*/</span>
        Put put2 <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Put</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span>attendedUid<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        put2<span class="token punctuation">.</span><span class="token function">addColumn</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span><span class="token string">&quot;fans&quot;</span><span class="token punctuation">)</span><span class="token punctuation">,</span> Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span>uid<span class="token punctuation">)</span><span class="token punctuation">,</span> Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span><span class="token string">&quot;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        relationTable<span class="token punctuation">.</span><span class="token function">put</span><span class="token punctuation">(</span>put2<span class="token punctuation">)</span><span class="token punctuation">;</span>

        <span class="token comment">/*3. &#x5728;&#x6536;&#x4EF6;&#x7BB1;&#x8868;&#x4E2D; uid(&#x5173;&#x6CE8;&#x4EBA;, &#x662F;&#x522B;&#x4EBA;&#x7684;&#x7C89;&#x4E1D;) &#x8FD9;&#x4E00;&#x884C;, info &#x65CF;&#x6DFB;&#x52A0;&#x4E00;&#x5217;: &#x5217;&#x540D;&#x662F; attendedUid, &#x5217;&#x503C;&#x5C31;&#x662F; attendedUid&#x7684;&#x6700;&#x65B0;&#x7684;&#x4E09;&#x6761;&#x5FAE;&#x535A;&#x7684;rowkey.*/</span>
        Table inboxTable <span class="token operator">=</span> conn<span class="token punctuation">.</span><span class="token function">getTable</span><span class="token punctuation">(</span>TableName<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span>WeiboConstant<span class="token punctuation">.</span>TBL_INBOX<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        Table contentTable <span class="token operator">=</span> conn<span class="token punctuation">.</span><span class="token function">getTable</span><span class="token punctuation">(</span>TableName<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span>WeiboConstant<span class="token punctuation">.</span>TBL_CONTENT<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        Scan scan <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Scan</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span>attendedUid<span class="token punctuation">)</span><span class="token punctuation">,</span> Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span>attendedUid <span class="token operator">+</span> <span class="token string">&quot;_a&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">// &#x626B;&#x63CF;&#x51FA;attendedUid_......&#x7684;&#x6240;&#x6709;&#x5FAE;&#x535A;</span>
        ResultScanner results <span class="token operator">=</span> contentTable<span class="token punctuation">.</span><span class="token function">getScanner</span><span class="token punctuation">(</span>scan<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">for</span> <span class="token punctuation">(</span>Result result <span class="token operator">:</span> results<span class="token punctuation">)</span> <span class="token punctuation">{</span>  <span class="token comment">// &#x5373;&#x4F7F;&#x6709;&#x591A;&#x6761;&#x5FAE;&#x535A;, &#x6700;&#x7EC8;&#x4E5F;&#x4F1A;&#x53EA;&#x4FDD;&#x7559; 3 &#x6761;</span>
            <span class="token keyword">byte</span><span class="token punctuation">[</span><span class="token punctuation">]</span> row <span class="token operator">=</span> result<span class="token punctuation">.</span><span class="token function">getRow</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            Put put3 <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Put</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span>attendedUid<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            put3<span class="token punctuation">.</span><span class="token function">addColumn</span><span class="token punctuation">(</span>
                    Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span><span class="token string">&quot;info&quot;</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
                    Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span>attendedUid<span class="token punctuation">)</span><span class="token punctuation">,</span>
                    Long<span class="token punctuation">.</span><span class="token function">parseLong</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span>row<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">&quot;_&quot;</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">,</span>  <span class="token comment">// &#x65F6;&#x95F4;&#x6233;&#x4FDD;&#x6301;&#x548C;&#x6DFB;&#x52A0;&#x5FAE;&#x535A;&#x65F6;&#x5019;&#x7684;&#x65F6;&#x95F4;&#x6233;&#x4E00;&#x81F4;</span>
                    row<span class="token punctuation">)</span><span class="token punctuation">;</span>
            inboxTable<span class="token punctuation">.</span><span class="token function">put</span><span class="token punctuation">(</span>put3<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>

    <span class="token comment">/**
     * &#x663E;&#x793A;&#x6307;&#x5B9A;&#x7528;&#x6237;&#x7684;&#x521D;&#x59CB;&#x5316;&#x4FE1;&#x606F;:
     * 1. &#x81EA;&#x5DF1;&#x7684;&#x6700;&#x65B0;&#x7684; 3 &#x6761;&#x5FAE;&#x535A;
     * &lt;p&gt;
     * 2. &#x6BCF;&#x4E2A;&#x5173;&#x6CE8;&#x7684;&#x4EBA;&#x7684;&#x6700;&#x65B0; 3 &#x6761;&#x5FAE;&#x535A;
     *
     * @param uid
     */</span>
    <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">showMsg</span><span class="token punctuation">(</span>String uid<span class="token punctuation">)</span> <span class="token keyword">throws</span> IOException <span class="token punctuation">{</span>
        Connection conn <span class="token operator">=</span> ConnectionFactory<span class="token punctuation">.</span><span class="token function">createConnection</span><span class="token punctuation">(</span>WeiboUtil<span class="token punctuation">.</span>conf<span class="token punctuation">)</span><span class="token punctuation">;</span>

        Table contentTable <span class="token operator">=</span> conn<span class="token punctuation">.</span><span class="token function">getTable</span><span class="token punctuation">(</span>TableName<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span>WeiboConstant<span class="token punctuation">.</span>TBL_CONTENT<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        Table inboxTable <span class="token operator">=</span> conn<span class="token punctuation">.</span><span class="token function">getTable</span><span class="token punctuation">(</span>TableName<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span>WeiboConstant<span class="token punctuation">.</span>TBL_INBOX<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        Table relationTable <span class="token operator">=</span> conn<span class="token punctuation">.</span><span class="token function">getTable</span><span class="token punctuation">(</span>TableName<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span>WeiboConstant<span class="token punctuation">.</span>TBL_RELATION<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

        <span class="token comment">/*1. &#x663E;&#x793A;&#x64CD;&#x4F5C;&#x8005;&#x7684;&#x6761;&#x5FAE;&#x535A;*/</span>
        Scan scan1 <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Scan</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span>uid<span class="token punctuation">)</span><span class="token punctuation">,</span> Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span>uid <span class="token operator">+</span> <span class="token string">&quot;_a&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        ResultScanner results <span class="token operator">=</span> contentTable<span class="token punctuation">.</span><span class="token function">getScanner</span><span class="token punctuation">(</span>scan1<span class="token punctuation">)</span><span class="token punctuation">;</span>

        System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span><span class="token string">&quot;&#x64CD;&#x4F5C;&#x8005;&quot;</span> <span class="token operator">+</span> uid <span class="token operator">+</span> <span class="token string">&quot;&#x7684;&#x6240;&#x6709;&#x5FAE;&#x535A;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">for</span> <span class="token punctuation">(</span>Result result <span class="token operator">:</span> results<span class="token punctuation">)</span> <span class="token punctuation">{</span>
            List<span class="token generics function"><span class="token punctuation">&lt;</span>Cell<span class="token punctuation">&gt;</span></span> cells <span class="token operator">=</span> result<span class="token punctuation">.</span><span class="token function">listCells</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span>CellUtil<span class="token punctuation">.</span><span class="token function">cloneRow</span><span class="token punctuation">(</span>cells<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">+</span> <span class="token string">&quot; : &quot;</span> <span class="token operator">+</span> Bytes<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span>CellUtil<span class="token punctuation">.</span><span class="token function">cloneValue</span><span class="token punctuation">(</span>cells<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>

        <span class="token comment">/*2. &#x663E;&#x793A;&#x64CD;&#x4F5C;&#x8005;&#x5173;&#x6CE8;&#x7684;&#x6240;&#x6709;&#x4EBA;&#x7684;&#x6700;&#x65B0; 3 &#x6761;&#x5FAE;&#x535A; &#x5728;&#x6536;&#x4EF6;&#x7BB1;&#x4E2D;&#x67E5;&#x627E;*/</span>
        Get inboxGet <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Get</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span>uid<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        inboxGet<span class="token punctuation">.</span><span class="token function">addFamily</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span><span class="token string">&quot;info&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        inboxGet<span class="token punctuation">.</span><span class="token function">setMaxVersions</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        Result result <span class="token operator">=</span> inboxTable<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span>inboxGet<span class="token punctuation">)</span><span class="token punctuation">;</span>
        Cell<span class="token punctuation">[</span><span class="token punctuation">]</span> cells <span class="token operator">=</span> result<span class="token punctuation">.</span><span class="token function">rawCells</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">for</span> <span class="token punctuation">(</span>Cell cell <span class="token operator">:</span> cells<span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token keyword">byte</span><span class="token punctuation">[</span><span class="token punctuation">]</span> rowKey <span class="token operator">=</span> CellUtil<span class="token punctuation">.</span><span class="token function">cloneRow</span><span class="token punctuation">(</span>cell<span class="token punctuation">)</span><span class="token punctuation">;</span>
            System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span>rowKey<span class="token punctuation">)</span> <span class="token operator">+</span> <span class="token string">&quot;&#x5173;&#x6CE8;&#x7684; :  &quot;</span> <span class="token operator">+</span> Bytes<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span>CellUtil<span class="token punctuation">.</span><span class="token function">cloneQualifier</span><span class="token punctuation">(</span>cell<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">+</span> <span class="token string">&quot; &#x7684;&#x5FAE;&#x535A;:&quot;</span> <span class="token operator">+</span> Bytes<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span>CellUtil<span class="token punctuation">.</span><span class="token function">cloneValue</span><span class="token punctuation">(</span>cell<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>

    <span class="token comment">/**
     * &#x53D6;&#x6D88;&#x5173;&#x6CE8;:
     * 1. &#x7528;&#x6237;&#x5173;&#x7CFB;&#x8868;&#x4E2D; uid&#x8FD9;&#x884C; &#x7684;attends&#x65CF;&#x4E2D;&#x5220;&#x9664;attendId&#x8FD9;&#x5217;
     *
     * 2. &#x7528;&#x6237;&#x5173;&#x7CFB;&#x8868;&#x4E2D; attendId &#x8FD9;&#x884C;&#x7684; fans&#x65CF;&#x4E2D;&#x5220;&#x9664; uid &#x8FD9;&#x5217;
     *
     * 3. &#x6536;&#x4EF6;&#x7BB1;&#x8868;&#x4E2D; uid &#x8FD9;&#x884C; &#x5220;&#x9664; attendId &#x8FD9;&#x5217;
     *
     * @param uid &#x64CD;&#x4F5C;&#x7684;&#x7528;&#x6237;
     * @param attendId &#x53D6;&#x6D88;&#x5173;&#x6CE8;&#x8C01;
     */</span>
    <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">removeAttends</span><span class="token punctuation">(</span>String uid<span class="token punctuation">,</span> String attendId<span class="token punctuation">)</span> <span class="token keyword">throws</span> IOException <span class="token punctuation">{</span>
        Connection conn <span class="token operator">=</span> ConnectionFactory<span class="token punctuation">.</span><span class="token function">createConnection</span><span class="token punctuation">(</span>WeiboUtil<span class="token punctuation">.</span>conf<span class="token punctuation">)</span><span class="token punctuation">;</span>
        Table relationTab <span class="token operator">=</span> conn<span class="token punctuation">.</span><span class="token function">getTable</span><span class="token punctuation">(</span>TableName<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span>WeiboConstant<span class="token punctuation">.</span>TBL_RELATION<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        Table inboxTable <span class="token operator">=</span> conn<span class="token punctuation">.</span><span class="token function">getTable</span><span class="token punctuation">(</span>TableName<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span>WeiboConstant<span class="token punctuation">.</span>TBL_INBOX<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

        List<span class="token generics function"><span class="token punctuation">&lt;</span>Delete<span class="token punctuation">&gt;</span></span> dels <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">ArrayList</span><span class="token operator">&lt;</span><span class="token operator">&gt;</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token comment">/*1. &#x7528;&#x6237;&#x5173;&#x7CFB;&#x8868;&#x4E2D; uid&#x8FD9;&#x884C; &#x7684;attends&#x65CF;&#x4E2D;&#x5220;&#x9664;attends&#x8FD9;&#x5217;*/</span>
        Delete delAttendId <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Delete</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span>uid<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        delAttendId<span class="token punctuation">.</span><span class="token function">addColumn</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span><span class="token string">&quot;attends&quot;</span><span class="token punctuation">)</span><span class="token punctuation">,</span> Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span>attendId<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        dels<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>delAttendId<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token comment">/*2. &#x7528;&#x6237;&#x5173;&#x7CFB;&#x8868;&#x4E2D; attendId &#x8FD9;&#x884C;&#x7684; fans&#x65CF;&#x4E2D;&#x5220;&#x9664; uid &#x8FD9;&#x5217;*/</span>
        Delete delFansId <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Delete</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span>attendId<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        delFansId<span class="token punctuation">.</span><span class="token function">addColumn</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span><span class="token string">&quot;fans&quot;</span><span class="token punctuation">)</span><span class="token punctuation">,</span> Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span>uid<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        dels<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>delFansId<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token comment">// &#x6279;&#x91CF;&#x5220;&#x9664;</span>

        relationTab<span class="token punctuation">.</span><span class="token function">delete</span><span class="token punctuation">(</span>dels<span class="token punctuation">)</span><span class="token punctuation">;</span>

        <span class="token comment">/*3. &#x6536;&#x4EF6;&#x7BB1;&#x8868;&#x4E2D; uid &#x8FD9;&#x884C; &#x5220;&#x9664; attendId &#x8FD9;&#x5217;*/</span>
        Delete delInbox <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Delete</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span>uid<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token comment">// &#x56E0;&#x4E3A;&#x6709;&#x591A;&#x4E2A;&#x7248;&#x672C;, &#x8981;&#x5220;&#x9664;&#x6240;&#x6709;&#x7684;&#x7248;&#x672C;&#x9700;&#x8981;&#x4F7F;&#x7528;addColumns&#x65B9;&#x6CD5;</span>
        delInbox<span class="token punctuation">.</span><span class="token function">addColumns</span><span class="token punctuation">(</span>Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span><span class="token string">&quot;info&quot;</span><span class="token punctuation">)</span><span class="token punctuation">,</span> Bytes<span class="token punctuation">.</span><span class="token function">toBytes</span><span class="token punctuation">(</span>attendId<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        inboxTable<span class="token punctuation">.</span><span class="token function">delete</span><span class="token punctuation">(</span>delInbox<span class="token punctuation">)</span><span class="token punctuation">;</span>


    <span class="token punctuation">}</span>

<span class="token punctuation">}</span>
</code></pre>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; &#x5C1A;&#x7845;&#x8C37;&#x5927;&#x6570;&#x636E; 2019 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification"><br>&#x8BE5;&#x6587;&#x4EF6;&#x6700;&#x540E;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2018-11-20 18:14:19
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="103-weiutil-lei.html" class="navigation navigation-prev navigation-unique" aria-label="Previous page: 10.3 WeiUtil 类">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"10.4 Weibo 类","level":"1.10.4","depth":2,"previous":{"title":"10.3 WeiUtil 类","level":"1.10.3","depth":2,"path":"di-10-zhang-hbase-shi-zhan-zhi-gu-li-wei-bo/103-weiutil-lei.md","ref":"di-10-zhang-hbase-shi-zhan-zhi-gu-li-wei-bo/103-weiutil-lei.md","articles":[]},"dir":"ltr"},"config":{"plugins":["splitter","expandable-chapters-small","page-toc-button","-highlight","prism","prism-themes","tbfed-pagefooter","sitemap","change_girls","livereload"],"styles":{"website":"styles/website.css","ebook":"styles/ebook.css","pdf":"styles/pdf.css","mobi":"styles/mobi.css","epub":"styles/epub.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy 尚硅谷大数据 2019","modify_label":"<br>该文件最后修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{"css":["prismjs/themes/prism-solarizedlight.css"]},"disqus":{"shortName":"zhenchao125"},"livereload":{},"splitter":{},"change_girls":{"time":30,"urls":["http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/62171757.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/83394736.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/15906185.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/15906185.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/3394270.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/65028582.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/20359261.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/37472401.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/3355397.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/11075549.jpg-atguiguImg"]},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"sitemap":{"hostname":"http://bigdataatguigu.applinzi.com/"},"page-toc-button":{"maxTocDepth":3,"minTocSize":2},"prism-themes":{},"expandable-chapters-small":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":" 李振超","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"大数据 bigdata_hbase_atguigu 课堂笔记","language":"zh-hans","links":{"sidebar":{"联系我们":"http://www.atguigu.com/"}},"gitbook":"*","description":"课堂笔记,学生提前预习"},"file":{"path":"di-10-zhang-hbase-shi-zhan-zhi-gu-li-wei-bo/104-weibo-lei.md","mtime":"2018-11-20T10:14:19.763Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-03-29T00:33:25.667Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-page-toc-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-change_girls/girls.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

